package org.come.shortcut;

import com.updateNew.MyIsif;
import org.come.Frame.DreamlandTrialMainJframe;
import org.come.shortcut.XBjczBtn;
import com.tool.btn.FormsOnOffBtn;
import com.tool.tcpimg.UIUtils;
import org.come.shortcut.XBjczJpanelzr;
import org.come.entity.Baby;
import org.come.entity.Goodstable;
import org.come.mouslisten.BabyPartsMouslisten;
import org.come.mouslisten.ChangeBabyMouslisten;
import org.come.shortcut.XBjczJpanelxz;
import org.come.until.GoodsListFromServerUntil;

import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;

//import static org.come.test.Main.imageMap;


public class XBjczJpanel extends JPanel {

    private XBjczJpanelzr xBjczJpanelzr;
    private XBjczBtn labAttr,labAttr1,// 快捷助手
            labTalent,labTalent1;// 无尽挑战
    private XBjczBtn dreamlandTrialMain,dreamlandTrialMain1,// 幻境试炼
            ladder,ladder1;// 天梯


    // 孩子 表id
    private BigDecimal babyid;

    public XBjczJpanel() throws Exception {
        if(MyIsif.getStyle().equals("水墨UI")) {
            this.setPreferredSize(new Dimension(658, 474));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/old/1/B448.png", 1, 3100);
            offBtn.setBounds(658 - 37, 10, 25, 25);
            this.add(offBtn);

            xBjczJpanelzr = new XBjczJpanelzr();
            xBjczJpanelzr.setBounds(0, 55, 658, 474-55);
            this.add(xBjczJpanelzr);

            // 快捷助手
            labAttr = new XBjczBtn("skin/8100226/newbutton/K02.png", 1);
            labAttr.setBounds(80, 23, 95, 33);
            labAttr.addMouseListener(new XBjczJpanelxz(1, xBjczJpanelzr));
            this.add(labAttr);
            // 幻境试炼
            dreamlandTrialMain = new XBjczBtn("skin/8100226/newbutton/K03.png", 1);
            dreamlandTrialMain.setBounds(80 + 98, 23, 95, 33);
            dreamlandTrialMain.addMouseListener(new XBjczJpanelxz(2, xBjczJpanelzr));
            this.add(dreamlandTrialMain);
/*            // 天梯
            ladder = new XBjczBtn("skin/8100226/newbutton/K73.png", 1);
            ladder.setBounds(80 + 98*2, 23, 95, 33);
            ladder.addMouseListener(new XBjczJpanelxz(3, xBjczJpanelzr));
            this.add(ladder);*/
            // 无尽挑战
            labTalent = new XBjczBtn("skin/8100226/newbutton/K75.png", 1);
            labTalent.setBounds(80 + 98*2, 23, 95, 33);
            labTalent.addMouseListener(new XBjczJpanelxz(4, xBjczJpanelzr));
            this.add(labTalent);
        } else {
            this.setPreferredSize(new Dimension(658, 474));
            this.setLayout(null);
            this.setBackground(UIUtils.Color_BACK);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/2/8_jpg.button.btn_close(1).png", 1, 3100);
            offBtn.setBounds(658 - 27, -3, 23, 23);
            this.add(offBtn);

            xBjczJpanelzr = new XBjczJpanelzr();
            xBjczJpanelzr.setBounds(0, 55, 658, 474-55);
            this.add(xBjczJpanelzr);

            // 快捷助手
            labAttr1 = new XBjczBtn("skin/8100226/button/hongmu/K02h.png", 1);
            labAttr1.setBounds(80, 23, 95, 33);
            labAttr1.addMouseListener(new XBjczJpanelxz(1, xBjczJpanelzr));
            this.add(labAttr1);
            // 幻境试炼
            dreamlandTrialMain1 = new XBjczBtn("skin/8100226/button/hongmu/ss677.png", 1);
            dreamlandTrialMain1.setBounds(80 + 98, 23, 95, 33);
            dreamlandTrialMain1.addMouseListener(new XBjczJpanelxz(2, xBjczJpanelzr));
            this.add(dreamlandTrialMain1);
//            // 天梯
//            ladder1 = new XBjczBtn("skin/8100226/button/hongmu/K74h.png", 1);
//            ladder1.setBounds(80 + 98*2, 23, 95, 33);
//            ladder1.addMouseListener(new XBjczJpanelxz(3, xBjczJpanelzr));
//            this.add(ladder1);
            // 无尽挑战
            labTalent1 = new XBjczBtn("skin/8100226/button/hongmu/ss679.png", 1);
            labTalent1.setBounds(80 + 98*2, 23, 95, 33);
            labTalent1.addMouseListener(new XBjczJpanelxz(4, xBjczJpanelzr));
            this.add(labTalent1);
        }
    }

    ImageIcon icon;
    ImageIcon icon2;

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        //
        if(MyIsif.getStyle().equals("水墨UI")) {
            if (icon == null) {
                icon = new ImageIcon("inkImg/newbackground/B201.png");
            }
            g.drawImage(icon.getImage(), 0, 0, 658, 474, this);
            if (icon != null) {
//                g.drawImage(icon.getImage(), 112, 34, 199, 299, this);
            }
        } else {
            if (icon2 == null) {
                icon2 = new ImageIcon("skin/8100226/button/hongmu/游戏助手红木.png");
            }
            g.drawImage(icon2.getImage(), 0, 0, 658, 474, this);
            if (icon2 != null) {
//                g.drawImage(icon2.getImage(), 112, 34, 199, 299, this);
            }
        }
    }

    int p = -1;


    public XBjczJpanelzr getXBjczJpanelzr() {
        return xBjczJpanelzr;
    }

    public void setXBjczJpanelzr(XBjczJpanelzr xBjczJpanelzr) {
        this.xBjczJpanelzr = xBjczJpanelzr;
    }

    public BigDecimal getBabyid() {
        return babyid;
    }

    public void setBabyid(BigDecimal babyid) {
        this.babyid = babyid;
    }

    public XBjczBtn getLabAttr() {
        return labAttr;
    }

    public void setLabAttr(XBjczBtn labAttr) {
        this.labAttr = labAttr;
    }

    public XBjczBtn getDreamlandTrialMain() {
        return dreamlandTrialMain;
    }

    public void setDreamlandTrialMain(XBjczBtn dreamlandTrialMain) {
        this.dreamlandTrialMain = dreamlandTrialMain;
    }
    public XBjczBtn getLadder() {
        return ladder;
    }

    public void setLadder(XBjczBtn ladder) {
        this.ladder = ladder;
    }

    public XBjczBtn getLabTalent() {
        return labTalent;
    }

    public void setLabTalent(XBjczBtn labTalent) {
        this.labTalent = labTalent;
    }

}
